3.193 \(\int \frac{\sec (x)}{\sec (x)+\tan (x)} \, dx\)

Optimal. Leaf size=10 \[ -\frac{\cos (x)}{\sin (x)+1} \]

[Out]

-(Cos[x]/(1 + Sin[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0244206, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3165, 2648} \[ -\frac{\cos (x)}{\sin (x)+1} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(Sec[x] + Tan[x]),x]

[Out]

-(Cos[x]/(1 + Sin[x]))

Rule 3165

Int[sec[(d_.) + (e_.)*(x_)]^(n_.)*((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(m_)
, x_Symbol] :> Int[1/(b + a*Cos[d + e*x] + c*Sin[d + e*x])^n, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[m + n, 0]
 && IntegerQ[n]

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin{align*} \int \frac{\sec (x)}{\sec (x)+\tan (x)} \, dx &=\int \frac{1}{1+\sin (x)} \, dx\\ &=-\frac{\cos (x)}{1+\sin (x)}\\ \end{align*}

Mathematica [B]  time = 0.0171352, size = 23, normalized size = 2.3 \[ \frac{2 \sin \left (\frac{x}{2}\right )}{\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(Sec[x] + Tan[x]),x]

[Out]

(2*Sin[x/2])/(Cos[x/2] + Sin[x/2])

________________________________________________________________________________________

Maple [A]  time = 0.061, size = 11, normalized size = 1.1 \begin{align*} -2\, \left ( \tan \left ( x/2 \right ) +1 \right ) ^{-1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(sec(x)+tan(x)),x)

[Out]

-2/(tan(1/2*x)+1)

________________________________________________________________________________________

Maxima [A]  time = 1.06971, size = 20, normalized size = 2. \begin{align*} -\frac{2}{\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(sec(x)+tan(x)),x, algorithm="maxima")

[Out]

-2/(sin(x)/(cos(x) + 1) + 1)

________________________________________________________________________________________

Fricas [A]  time = 0.461033, size = 62, normalized size = 6.2 \begin{align*} -\frac{\cos \left (x\right ) - \sin \left (x\right ) + 1}{\cos \left (x\right ) + \sin \left (x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(sec(x)+tan(x)),x, algorithm="fricas")

[Out]

-(cos(x) - sin(x) + 1)/(cos(x) + sin(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{\tan{\left (x \right )} + \sec{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(sec(x)+tan(x)),x)

[Out]

Integral(sec(x)/(tan(x) + sec(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.12133, size = 14, normalized size = 1.4 \begin{align*} -\frac{2}{\tan \left (\frac{1}{2} \, x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(sec(x)+tan(x)),x, algorithm="giac")

[Out]

-2/(tan(1/2*x) + 1)